WPS Office.apk(点击下载) / sjp.java


package defpackage;

import java.util.Iterator;

/* renamed from: sjp  reason: default package */
public final class sjp {
    public qxj book;

    public sjp(qxj qxj) {
        this.book = qxj;
    }

    public final void a(coj coj) {
        short s;
        int i = 0;
        Iterator<rqu> eXZ = this.book.sMr.eXZ();
        while (eXZ.hasNext()) {
            eXZ.next();
            i++;
        }
        coj.r("uniqueCount", i);
        coj.r("count", i);
        coj.M(null, "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
        Iterator<rqu> eXZ2 = this.book.sMr.eXZ();
        while (eXZ2.hasNext()) {
            rqu next = eXZ2.next();
            coj.gl("si");
            String string = next.getString();
            int faJ = next.faJ();
            string.length();
            if (faJ != 0) {
                short faF = next.aff(0).faF();
                if (faF == 0 || faF > string.length() || faF < 0) {
                    faF = 0;
                } else {
                    coj.gl("r");
                    b(coj, string.substring(0, faF));
                    coj.endElement("r");
                }
                int i2 = 0;
                short s2 = faF;
                while (i2 < faJ) {
                    short faF2 = next.aff(i2).faF();
                    if (i2 != faJ - 1) {
                        short faF3 = next.aff(i2 + 1).faF();
                        if (faF3 > string.length() || faF3 < s2) {
                            break;
                        }
                        s = faF3;
                    } else {
                        s = string.length();
                    }
                    if (s2 < s) {
                        rcx rcx = this.book.sMB;
                        int faJ2 = next.faJ();
                        rqp rqp = null;
                        int i3 = 0;
                        while (i3 < faJ2) {
                            rqp aff = next.aff(i3);
                            if (aff.faF() > faF2) {
                                break;
                            }
                            i3++;
                            rqp = aff;
                        }
                        rcq acE = rcx.acE(rqp == null ? 0 : rqp.eSS());
                        coj.gl("r");
                        if (acE != null) {
                            coj.gl("rPr");
                            slb.b(coj, acE);
                            coj.gl("rFont");
                            coj.J("val", acE.cYS());
                            coj.endElement("rFont");
                            coj.endElement("rPr");
                        }
                        b(coj, string.substring(s2, s));
                        coj.endElement("r");
                    }
                    i2++;
                    s2 = s;
                }
            } else {
                b(coj, string);
            }
            coj.endElement("si");
        }
    }

    public void b(coj coj, String str) {
        char charAt;
        char charAt2;
        boolean z = true;
        coj.gl("t");
        if (str.length() > 0 && str.charAt(str.length() - 1) == 0) {
            str = str.substring(0, str.length() - 1) + "_x0000_";
        }
        int length = str.length();
        if (length == 0 || !((charAt = str.charAt(0)) == '\n' || charAt == '\r' || charAt == ' ' || charAt == '\t' || (charAt2 = str.charAt(length - 1)) == '\n' || charAt2 == '\r' || charAt2 == ' ' || charAt2 == '\t')) {
            z = false;
        }
        if (z) {
            coj.J("xml:space", "preserve");
        }
        coj.addText(cog.d(str, cog.cmi));
        coj.endElement("t");
    }
}